import serial
import time
import binascii
from hex import HexStrFromFile

if __name__ == '__main__':
    ser = serial.Serial(1)  # open first serial port
    print ser

    hexstr = HexStrFromFile('d:\\CDTFrame1.txt')
    print hexstr

    frame = binascii.a2b_hex(hexstr)
    while (1):
        ser.write(frame)
        print 'send frame'
        time.sleep(600)
        
    print 'end'